%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% outils

% less_than_or_equal(M,N) <- M is less than or equal to M

less_than_or_equal(0,N) :- natural_number(N).
less_than_or_equal(s(M),s(N)) :- less_than_or_equal(M,N).

% minimum(M,N,Min) <- Min is the minimum of {M, N}

minimum(M,N,M) :- less_than_or_equal(M,N).
minimum(M,N,N) :- less_than_or_equal(N,M).

%renvoi les coordonnées pondérés
minimumcoor([M,X1], [N,_], [M,X1]) :- less_than_or_equal(M,N).
minimumcoor([M,_], [N,X2], [N,X2]) :- less_than_or_equal(N,M).


/* Récupère l'élément X dans une liste (génératif) */
	element(X,[X|_]).
	element(X,[_|Q]) :- element(X,Q).
